-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let cond
of an empty square matrix return zero
#1169
Conversation
Thinking about this a bit more, this seems sensible, at least for square empty matrices. For square matrices, we define the condition number as Returning 0 is also what Matlab does, it seems. |
Agree, restricting to square |
Would be good to have a |
8d67cf5
to
8164756
Compare
cond
of an empty matrix return zerocond
of an empty square matrix return zero
Fixes #778. Co-authored-by: Steven G. Johnson <[email protected]>
8164756
to
602578d
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1169 +/- ##
=======================================
Coverage 91.89% 91.89%
=======================================
Files 34 34
Lines 15355 15358 +3
=======================================
+ Hits 14110 14113 +3
Misses 1245 1245 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Steven G. Johnson <[email protected]>
Transfer of JuliaLang/julia#38372. Summary of the discussion there:
We have this inconsistency:
If it wasn't breaking, making all cases throw would be acceptable behavior. This PR goes the other way, making the
p==2
case also return zero. Although met with some skepticism, if there is to be chosen a value, zero is probably it.I think the main question is whether the inconsistency or the somewhat dubious return-value is the lesser evil. Mainly porting this over as a reminder to reach a decision. Either way we should probably close #778; either by resolving it with this PR or as won't-fix.
Fixes #778.